import React, {
    Component,
} from 'react';
import {
    StyleSheet,
    Text,
    View,
    Platform,
    Dimensions,
    TouchableOpacity,
    Image,
    Alert,
    FlatList,
    TextInput,
    Linking,
    ScrollView,
    Switch,
    DeviceEventEmitter,
} from 'react-native';
import AndroidModule from 'src/utils/AndroidConnent'
import Loading from "../../../utils/Loading";
import HttpUtils from '../../../utils/HttpUtils';
import HttpUrls from '../../../utils/HttpUrls';
import Header from "../../../components/header";

let navigation

export default class CarOperateSuccessPage extends Component {
    constructor(props) {
        super(props);
        let operateTitle = this.props.route && this.props.route.params && this.props.route.params.operateTitle ? this.props.route.params.operateTitle : ''
        super(props);
        this.state = {
            operateTitle
        }
    }

    componentDidMount() {

    }

    render() {
        navigation = this.props.navigation;
        return (
            <View style={styles.container}>
                <Header navigation={navigation} Title={' '} hideSepLine={true}></Header>
                <ScrollView
                    style={{ flex: 1 }}
                >
                    <View style={styles.operateBox}>
                        <Image style={styles.successImg} source={require('source/image/operate_success.png')} />
                        <Text style={styles.operateText}>
                            {
                                this.state.operateTitle
                            }
                        </Text>

                        <TouchableOpacity
                            style={styles.backBtn}
                            onPress={()=>{
                                navigation.goBack()
                                if (this.props.route.params.completion) {
                                    this.props.route.params.completion()
                                }
                            }}
                        >
                            <Text style={styles.backText}>返回</Text>
                        </TouchableOpacity>
                    </View>
                </ScrollView>



            </View>
        )
    }

}

const styles = StyleSheet.create({
    container: {
        flex: 1,
        backgroundColor: '#fff',
    },
    operateBox: {
        marginTop: 30,
        flexDirection: 'column',
        width: '100%',
        alignItems: 'center',
    },
    successImg: {
        width: 40,
        height: 40
    },
    operateText: {
        lineHeight: 26,
        marginTop: 20,
        color: '#000',
        fontSize: 16,
        fontWeight: '500'
    },
    backBtn: {
        marginTop: 80,
        paddingHorizontal: 16,
        height: 26,
        flexDirection: 'row',
        alignItems: 'center',
        borderRadius: 4,
        borderWidth: 1,
        borderColor: '#999999'
    },
    backText: {
        fontSize: 14,
        color: '#999999'
    }

})